   <?php

   $query = mysql_query("SELECT * FROM pages WHERE is_validated = '0' ORDER BY time_submitted DESC") or
            die(mysql_error());
        echo "<h1>Unreviewed Pages</h1>";
        if (mysql_num_rows($query) == 0) {
            echo "pages unreviewed!";
        }
        //there are rows, show the tutorials to
        //verify them
        else {
            //echo the submit buttons
            echo "
        <form action='admintemplate.php?action=handle' method='post'>
        <table border='0' cellpadding='0' cellspacing='0' width='500'>
            <tr>
                <td><center>With Selected</center></td>
            </tr>
            <tr>
                <td colspan='2'><center><input type='submit' name='validate_tutorials' value='Validate'><input type='submit' name='delete_tutorials' value='Delete'></center></td>
            </tr>
            <tr>
                <td colspan='2'><hr /></td>
            </tr>
        ";
            //loop throught it to show them all
            while ($row = mysql_fetch_array($query)) {
                echo "
            <tr>
                <td>Title:</td>
                <td>$row[title]</td>
            </tr>
            <tr>
                <td>Submitter:</td>
                <td>$row[submitter]</td>
            </tr>
            <tr>
                <td>Short Description:</td>
                <td>$row[short_description]</td>
            </tr>
            <tr>
                <td>Tutorial Text:</td>
                <td>$row[text]</td>
            </tr>
            <tr>
                <td>Email:</td>
                <td><a href='mailto:$row[email]'>$row[email]</a></td>
            </tr>
            <tr>
                <td><b>Mark</b></td>
                <td><input type='checkbox' name='row[]' value='$row[id]'></td>
            </tr>
            <tr>
                <td colspan='2'><hr /></td>
            </tr>
            ";
            }
            echo "
        </table>
        ";
        }
		
		?>